package aiku.numericalcontroloa.Mapper.OrderManagement;

import aiku.numericalcontroloa.Model.Entity.OrderManagement.Order;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Collection;
import java.util.List;

/**
 * @Author 黄广庭
 * @Date 2024/3/19 11:58
 */
@Repository
public interface OrderMapper extends BaseMapper<Order> {

    /**
     * 根据客户id集合查询订单;
     * 可根据付款状态查询，status为null查全部;
     * @param clientsIdList
     * @param status
     * @return
     */
    List<Order> selectBatchClientsIdWithDelete(@Param(value = "list")Collection<String> clientsIdList,
                                        @Param(value = "status")Integer status);

    /**
     * 根据订单id集合批量查询已删除;
     * 可根据付款状态查询，status为null查全部;
     * @param orderIdList
     * @return
     */
    List<Order> selectBatchIdWithDelete(@Param(value = "list")Collection<String> orderIdList,
                                        @Param(value = "status")Integer status);

    /**
     * 根据id查询删除的
     * @param id
     * @return
     */
    Order selectByIdWithDelete(@Param(value = "id")String id);

    /**
     * 批量更新状态
     * @param orderList
     * @return
     */
    int updateBatchForStatus(@Param(value = "list")List<Order> orderList);
}
